home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.teleport.com!usenet
- From: GHouck <hksys@teleport.com>
- Newsgroups: comp.lang.c
- Subject: Re: Why does this trip over control codes (Win 3.1 SDK)
- Date: 13 Apr 1996 07:15:16 GMT
- Organization: systems hk
- Message-ID: <4knka4$i9s@nadine.teleport.com>
- References: <4kjnoe$di2@pipe10.nyc.pipeline.com>
- NNTP-Posting-Host: ip-pdx14-40.teleport.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
-
- johndill@nyc.pipeline.com (John Dillworth) wrote:
- >I'm trying to modify the poepoem.c program from Petzold to print source
- >code instead of just text. The .rc file looks like this
- >
- [snip]
- >The AnnabelLee TEXT poepoem.asc line points to an text file. It prints
- >just fine. If I want the program to print source code it has a problem
- >with the C control characters and stops printing when it hits one. The
- >fragment from the >c file is
- >
- [snip]
- >
- > while (*lpText != '\\' && *lpText != '\0')
- > {
- > if (*lpText == '\n')
- > nNumLines ++ ;
- > lpText = AnsiNext (lpText) ;
- [snip]
-
- John,
-
- I don't know why this snippet is checking for '\', but if you take
- the '*lpText != '\\' &&' out of the test, it won't stop on a
- backslash character, which it will now, and C programs are likely
- to have a few of...
-
- Yours, Geoff Houck
-
-